import base64

def img2string(img, para):
    with open(img, 'rb') as f:
        string = base64.b64encode(f.read()).decode()
    with open('Image.py', 'a') as f:
        f.write('%s = base64.b64decode("%s")\n'%(para, string))

if __name__ == '__main__':
    img2string('donate/37-微信.png', 'img1')
    img2string('donate/赞赏码3副本2.png', 'img2')

img1 = base64.b64decode("iVBORw0KGgoAAAANSUhEUgAAAHUAAAB1AQAAAABYf5MRAAAACXBIWXMAAAsTAAALEwEAmpwYAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAACGUlEQVR42pRVMYrbQBR9M7MgN5Gc0jCbMewBFncKGEZbbW4RSA4QK9ukiuVUbiLtCfYCOYE7CwJyly6dQV4JvCGElV1ZoNFPmyyEmUz3+Y/Pe2/e/GGEvw6z1CgBSjSgZXACNH/SflqfCWprfyM61F8ioisbnmMRmcManzajBrsh7HgAmIwaXAz/3f+DDwARRyL5ll/+eLDjUdGp6nUH3fkh9Va93LABbtt92u4TMG7nowim2UhW1EeP4KD3Nj8DzudsREuX+ebxWon16+bK+/VKvYusestZWDW66lEd1lVi1yueZzJYTo/AnR71LvfV1ocPJSBn+Z474H09yha7rDifR1Pffl9lfCIiIurmp9LXdnxQyBlkXKhUd3Oy8pGYlAGVANhKvHfIT6JVAxkXEqFKtcP83CyoBERWOOSZm9QDsTFg4mh378AnDYmIDqSyUxdb9aKLqYsLGRcSWtrfO99/fjkGAIhstW/sfCj1VK+JqPvoSbv/Z7tqNV6sav/7iB1+2vPAVXCtg8H0biL4ZppZ8893/cQ0ettsTOPBZX7iFTz3ht7Fi8nWwf9yBuo19R71EGT3n4hKP1RJiJkuZ3b/d4yJm6IOMvgt7uCynx9MtL1s1NDD29RlPyveimbz9ZhfJC75D7uYVK+p17C/Rw6gfhaZmyW7WeKN036mNAQ7qVQru5/csAFYRo9Bft+auTUP7D//x98DAKDb/hB0kBvsAAAAAElFTkSuQmCC")
img2 = base64.b64decode("iV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